﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 招聘网站
{
    public partial class Form3 : Form
    {
       
        public Form3()
        {
            InitializeComponent();
        }

        private void label5_Click(object sender, EventArgs e)
        {

        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
                string a="";
               if (radioButton1.Checked == true)
                a = radioButton1.Text;
            else
                a = radioButton2.Text;
              string SqlStr = "server=.;database=zhaopin;integrated security=SSPI";
                SqlConnection con = new SqlConnection(SqlStr);
                con.Open();
                SqlCommand comm = new SqlCommand();
                comm.Connection = con;
                comm.CommandText = "insert into table_2(name,sex,born,cjgznf,hkszd,city,phonenumb,email,xuewei,cszhiye) values( '"+textBox1 .Text +"','" + a+ "','"+textBox3 .Text +"','"+comboBox1 .Text +"','"+textBox4 .Text +"','"+textBox5 .Text +"','"+textBox6 .Text +"','"+textBox7 .Text +"','"+Form4 .i +"','"+Form4 .u +"')";
                if (comm.ExecuteNonQuery() > 0)
                {
                  
                    MessageBox.Show("个人信息添加成功", "正确", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Form7 f7 = new Form7();
                    f7.Show();
                    this.Hide();
                }
                else
                    MessageBox.Show("未全部添加，请重新输入！", "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            textBox1.Clear();
            textBox3.Clear();
            textBox4.Clear();
            textBox5.Clear();
            textBox6.Clear();
            textBox7.Clear();
            textBox1.Focus();

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void Form3_Load(object sender, EventArgs e)
        {
            
        }
    }
}
